#include "RootBox.h"

namespace jm4bbx {


	int Box::nextBoxInstanceId_ = 0;


	Box::Box(bobox::box_id_type id, bobox::box_tid_type tid, bobox::request* req, const bobox::parameters& params, int forceSignalInCount /*= -1*/, int forceSignalOutCount /*= -1*/) : bobox::basic_box2(id, tid, req)
		, boxInstanceId_(nextBoxInstanceId_++) 
		, signalInCount_(0)
		, signalOutCount_(0) {
			if (forceSignalInCount < 0) {
				signalInCount_ = getBoxParameterValue(params, 
					BaseBoxDescriptor::SIGNAL_IN_PARAMETER_NAME, 0);
			}
			else {
				signalInCount_ = forceSignalInCount;
			}


			if (forceSignalOutCount < 0) {
				signalOutCount_ = getBoxParameterValue(params, 
					BaseBoxDescriptor::SIGNAL_OUT_PARAMETER_NAME, 0);
			}
			else {
				signalOutCount_ = forceSignalOutCount;
			}
	}

} // namespace jm4bbx
